#!/bin/bash
force_update=$(os_name=$(cat /etc/issue | awk '{print $1}');\
if [ "x${os_name}" == "xDebian" ]; then \
    os_version=$(cat /etc/issue | awk '{print $3}');\
    echo $(if ((${os_version} > 11 ));then echo '--break-system-packages';else echo ''; fi); \
elif [ "x${os_name}" == "xUbuntu" ]; then \
    os_version=$(cat /etc/issue | awk '{print $2}' | awk -F'.' '{print $1}');\
    echo $(if ((${os_version} > 22 ));then echo '--break-system-packages';else echo ''; fi); \
fi)

if [ -f /usr/lib/rpcf/oinit*.whl ]; then
    pip3 install ${force_update} --force-reinstall /usr/lib/rpcf/oinit*.whl 
fi
